import request from '@/utils/request'

// crm 业绩记录
export function achievementListAPI(data) {
  return request({
    url: 'crm/Record/index',
    method: 'post',
    data: data
  })
}

/**
 * 导出业绩
 * @param {*} data
 * customer_id 客户ID
 */
export function excelExportAPI(data) {
  return request({
    url: 'crm/record/excelExport',
    method: 'post',
    data: data,
    responseType: 'blob',
    timeout: 600000
  })
}

// crm 部门列表
export function structureListAPI(data) {
  return request({
    url: 'crm/Record/structureList',
    method: 'post',
    data: data
  })
}

// 获取部门和业务类型
export function getStrucAndCateAPI(data) {
  return request({
    url: 'hr/position/getStrucAndCate',
    method: 'post',
    data: data
  })
}

// crm 业绩排行
export function recordRankingAPI(data) {
  return request({
    url: 'crm/Index/recordRanking',
    method: 'post',
    data: data
  })
}